import React from 'react'
import axios from 'axios'
import { useState } from 'react';
import { useEffect } from 'react'

export default function Index() {
  let [inpValue, setInpValue] = useState("");
  useEffect(() => {
    document.onkeydown = (e) => {

      if (e.key === "Enter") {
        console.log("111");
        (async () => {
          let { data } = await axios.get("/api/storeList", { params: { inpValue } });
          // console.log(data);
          // setDetail(data.content);
        })();
      }

    }
  }, []);
  const changeInpValue = (e) => {
    setInpValue(e.target.value);
  }
  return (
    <div>
      <input type="text" value={inpValue} onChange={changeInpValue} className='myinput' placeholder='请输入需要做的任务，按enter按键添加' />
    </div>
  )
}
